package sctu.edu.java.year2016.team04.guoyicheng.day20160529.chapter8_3;

import sctu.edu.java.year2016.team03.liyouhong.day20160527.chapter8_2.Son;
import sctu.edu.java.year2016.team04.Liliang.day20160529.chapter8_1.Name;

/**
 * Created by yicheng on 2016/5/29.
 *尝试创建一个父类和子类，分别创建构造方法，然后向父类和子类添加成员变量和方法，并总结构建子类对象时的顺序。
 */
public class One1 {

    public static void main(String[] args) {
        son g = new son(1, 2);
        System.out.println("长为：" + g.Long);
        System.out.println("宽为：" + g.Wide);
    }

}

class Father {

    int Long;
    int Wide;

    public Father(int Long, int Wide) {
        this.Long = Long;
        this.Wide = Wide;
    }

    public int getLong() {
        return Long;
    }

    public int getWide() {
        return Wide;
    }

}


class son extends Father {

    son(int Long, int Wide) {

        super(Long, Wide);

    }
}





